Cloud services, delivered through cloud-based systems, are experiencing rapid growth. In fact, users and Information Technology (IT) administrators are using cloud services for more and more applications, as are end users. In such a globally distributed architecture where multiple applications, distributed across various data centers around the globe, are operating, it becomes more and more important to maintain statistics associated with various transactions. An exemplary cloud-based system is offered by Zscaler, Inc., the assignee of the present disclosure. Zscaler has a Nanolog server system which is a transaction logging system that processes millions of transaction log records each hour. It extracts a number of fields from the log records and updates corresponding statistic counters for each associated user. In a cloud architecture where a single Nanolog server is serving thousands of companies, storing statistic counters at a user level requires a large amount of memory. This presents a scalability problem as the number of users and application-specific counters increase. The traditional approach to solving this problem would involve persisting counters that cannot fit in memory, to disk. Any solution should minimize counter memory usage and optimize counter value updates.